
PRJ_NAME = "g-javascript-lib"
SRC_PATH = "src/js"
DOC_PARSER_PATH = "doc/parser"
DOC_GEN_PATH = "doc/generator"
DOC_TEMPLATE = "doc/template"

VERSION ?= 1.0.0

doc: 
	bin/yuidoc.py $(SRC_PATH) -m $(PRJ_NAME) -p $(DOC_PARSER_PATH) -o $(DOC_GEN_PATH) -t $(DOC_TEMPLATE) -v $(VERSION)

#Compress sources to a single file
JSSRC= src/js
SRC_BASE= $(JSSRC)/base/g.js $(JSSRC)/base/dom.js 
SRC_UTILS= $(JSSRC)/utils/list.js $(JSSRC)/utils/tree.js 
SRC_WIDGETS= $(JSSRC)/widget/scrollbar.js  \
			  $(JSSRC)/widget/datasource.js \
			  $(JSSRC)/widget/treeview.js \
			  $(JSSRC)/widget/toolbar.js \
			  $(JSSRC)/widget/barview.js \
			  $(JSSRC)/widget/listmenu.js \
			  $(JSSRC)/widget/keycmd.js \

SRC_SVG=$(JSSRC)/svg/board.js
SRC_ALL=$(SRC_BASE) $(SRC_UTILS) $(SRC_WIDGETS) $(SRC_SVG)

all: lib_js_all doc

lib_js_all: $(SRC_BASE) $(SRC_UTILS) $(SRC_WIDGETS) $(SRC_SVG)
	java -jar bin/yuicompressor.jar -o build/g-all.js $^
	

clean:
	rm -rf $(DOC_PARSER_PATH) $(DOC_GEN_PATH)

.PHONY: doc

